package model;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */


import java.util.ArrayList;


public class ListTaskGroup {
    //private int index;
    private ArrayList<TaskGroup> listTaskGr;
    
    public ListTaskGroup(){
        listTaskGr = new ArrayList();
    }
    
    public void add(TaskGroup taskgr){
        listTaskGr.add(taskgr);
    }
    public void removeAt(int index){
        listTaskGr.remove(index);
    }
    public int getSize(){
        return listTaskGr.size();
    }
    public TaskGroup getAt(int i){
        return listTaskGr.get(i);
    }
    public TaskGroup toTaskGroup(){
        TaskGroup tg = new TaskGroup("","For Alarm");
        for(int i = 0; i < listTaskGr.size(); i++){
            for(int j = 0; j < listTaskGr.get(i).getSize(); j++){
                tg.add(listTaskGr.get(i).getAt(j));
            }
        }
        return tg;
    }
    
    
}
